
/**
 *
 * @functionNameRules
 * 平台名称+接口名称+Api
 * eg: redirectTo函数 : ali(平台名称)+redirectTo(接口名称)+Api = aliRedirectToApi
 *
 **/


 "use strict"


/**
 *
 * @Describe redirectTo接口
 * @Effect 关闭当前页面，跳转到应用内的某个指定页面
 * @Author zpw
 * @Param null
 * @Create-time 2019/09/05
 * @Update-time 2019/09/11
 * @Literature  https://docs.alipay.com/mini/api/fh18ky
 *
 **/
export const aliRedirectToApi = (url) => {
	my.redirectTo({
	  	url: url,
	  	success: function(res){
        	console.log('success')
	    },
	    fail: function(error){
	        console.log('fail');
	    },
	    complete:function(){
	        console.log('complete');
	    }
	})
}


/**
 *
 * @Describe navigateTo接口
 * @Effect 从当前页面，跳转到应用内的某个指定页面
 * @Author zpw
 * @Param null
 * @Create-time 2019/09/05
 * @Update-time 2019/09/11
 * @Literature  https://docs.alipay.com/mini/api/zwi8gx
 *
 **/

export const aliNavigateToApi = (url) => {
	my.navigateTo({ 
 		url: url,
 		success: function(){
        	console.log('success')
	    },
	    fail: function(){
	        console.log('fail');
	    },
	    complete:function(){
	        console.log('complete');
	    }
 	})
}

 /**
 *
 * @Describe 
 * @Effect 
 * @Author zpw
 * @Param null
 * @Create-time 2019/09/11
 * @Update-time 2019/09/11
 * @Literature  
 *
 **/
export const aliCardPackageApi = (url) => {
	console.log("唤起卡包");
}

/**
 *
 * @Describe 当前文档基本信息
 * @Author zpw
 * @Param null
 * @Create-time 2019/09/05
 * @Update-time 2019/09/05
 * @Literature  
 *
 **/
export const aliDocumentInfomationApi = (url) => {
	return {
	  	"name" : "ali-api",
	  	"author" : "张盼伟",
	  	"phone" : "15600117320",
	  	"email" : "15600117320@163.com",
	  	"describe" : "通过传参方式回调小程序原生api供h5调用"
	  }
}

export default {
  aliRedirectToApi,
  aliNavigateToApi,
  aliCardPackageApi,
  aliDocumentInfomationApi
}

